﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace AppDesigner.DragDropEx
{
    public class DragDropInfo
    {
        public Point StartPosition { get; set; }
        public UIElement Source { get; set; }
        public Type SourceControlType { get; set; }

        public UIElement Target { get; set; }
        public Type TargetControlType { get; set; }
        public Point EndPosition { get; set; }

        public object DragDropData { get; set; }

        public void SetDragInfo(object sender, MouseButtonEventArgs e)
        {
            StartPosition = e.GetPosition(null);
            Source = sender as UIElement;
            SourceControlType = sender.GetType();
        }

        public void SetDragDropData(object dragDropData)
        {
            this.DragDropData = dragDropData;
        }

        public void SetDropInfo(object sender,DragEventArgs e)
        {
            Target = sender as UIElement;
            TargetControlType = sender.GetType();
            EndPosition = e.GetPosition(Target);
        }
    }
}
